package com.yhgarden.bbs.config;

import com.yhgarden.bbs.utils.common.ThreadUtils;
import org.springframework.context.ApplicationEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.concurrent.ExecutorService;

@Component
public class AppConfig implements ApplicationListener {

    @Bean
    public ExecutorService getExecutorService() {
        return ThreadUtils.getExecutorService();
    }

    @Override
    public void onApplicationEvent(ApplicationEvent applicationEvent) {
        //dosomething
    }
}
